#include<iostream>
#include<string>
using namespace std;
int main(){
	string s1,s2;
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> s1 >> s2;
		if(s1=="Rock"&&s2=="Scissors")cout << "Player1" << endl;
		else if(s2=="Rock"&&s1=="Scissors")cout << "Player2" << endl;
		else if(s1==s2)cout << "Tie" << endl;
		else if(s1=="Rock"&&s2=="Paper")cout << "Player2" << endl;
		else if(s2=="Rock"&&s1=="Paper")cout << "Player1" << endl;
		else if(s1=="Paper"&&s2=="Scissors")cout << "Player2" << endl;
		else if(s2=="Paper"&&s1=="Scissors")cout << "Player1" << endl;
		
	} 
	return 0;
}
